
/**
 * 判断用户是否有操作权限
 * 根据传入的权限标识，查看是否存在用户权限标志集合
 * @param perms
 */
export function hasPermission(perms) {
    let hasPermission = false
    const user = sessionStorage.getItem('user')
    if (!user) {
        return false
    }
    const permisson = JSON.parse(user)
    for (let i = 0; i < permisson.perms.length; i++) {
        if (permisson.perms[i] === perms) {
            hasPermission = true
            break
        }
    }
    return hasPermission
}
